package com.object.utils;

import org.springframework.boot.devtools.restart.FailureHandler;
import org.springframework.boot.devtools.restart.Restarter;

public class SpringBootFlushed
{
    public static Q flushed()
    {
        Q ok = Q.ok();
        Restarter restarter = Restarter.getInstance();
        ok.message("系统重启中......");
        restarter.restart(new FailureHandler()
        {
            public Outcome handle(Throwable failure)
            {
                ok.message("当前系统出现问题，无法重启项目...........");
                return Outcome.ABORT;
            }
        });
        return ok;
    }
}
